<?php $this->_extends('../_layouts/default_layout'); ?>
<?php $this->_block('contents'); ?>
<script type="text/javascript">
$(function(){
	$(".base_btn").click(function(){
		parent.window.location.href="<?=url('Online::EbayTemplate/BasePartCreate', array('id' => $_GET['id']))?>";
	});
	$( "#t_module li a" ).click(function(){
		$(this).parent().toggleClass("current");
	});
});
</script>
<style>
#t_module {margin:10px 0;border-bottom:1px solid #ccc; height: 30px; border-top:2px soild #ccc;}
#t_module li {float:left; text-align:center; padding: 5px 10px; margin-right: 10px; background: #eee;  }
#t_module li.current {background:#00c;}
#t_module li.current a {background:#00c;color:#fff;}
</style>
<form>
<fieldset><legend><strong>模板模块信息列表</strong></legend>
<table class="form_table" width="70%">
<tr>
	<th>所属模板</th>
	<td><strong><?=$template['name']?></strong></td>
	<th>模板路径</th>
	<td><strong><?=$template['path']?></strong></td>
</tr>
<tr>
	<th>所属店铺</th>
	<td><strong><?=$template['shop_name']?></strong></td>
	<th>店铺路径</th>
	<td><strong><?=$template['shop_path']?></strong></td>
</tr>
</table>
</fieldset>
</form>
<ul id="t_module" class="clearfix">
	<?foreach ($template['module'] as $k => $m):?>
	<li <?if (isset($_GET['mid'])){if($m['ebay_template_module_id']==$_GET['mid'])echo "class='current'";}else{if($k == 0)echo "class='current'";}?>><a href="<?=url('Online::EbayTemplate/TemplateDetail', array('id' => $_GET['id'], 'mid' => $m['ebay_template_module_id']))?>"><?=$m['name']?></a></li>
	<?endforeach;?>
</ul>
<table class="list_table" width="100%">
<tr>
	<th width="40">ID</th>
	<th width="100">所属模块</th>
	<th width="100">标题</th>
	<th width="120">图片</th>
	<th width="60">价格</th>
	<th width="200">链接地址</th>
	<th width="30">排序</th>
</tr>
<?if (isset($content)):?>
<?foreach ($content as $c):?>
<tr>
	<td><?=$c['id']?></td>
	<td><?=$c['module_name']?></td>
	<td><?=$c['title']?></td>
	<td><?=$c['image']?></td>
	<td><?=$c['price']?></td>
	<td><a href="<?=$c['url']?>"><?=$c['url']?></a></td>
	<td><?=$c['sort']?></td>
</tr>
<?endforeach;?>
<?endif;?>
</table>
<a href="<?=url('Online::EbayTemplate/TemplateModuleContentEdit', array('id' =>$_GET['id'], 'mid' => (isset($_GET['mid']) ? $_GET['mid'] : '')))?>"><input type="button" class="button" value="编辑" /></a>
<?php $this->_endblock();?>